package br.com.agiledev.webscrum.comuns;

import java.util.Comparator;

import br.com.agiledev.webscrum.entity.ItemRelease;

public class ItemReleaseComparator implements Comparator<ItemRelease> {

    private static ItemReleaseComparator instance;

    @Override
    public int compare(ItemRelease o1, ItemRelease o2) {

	// compara os itens
	return ItemComparator.getInstance().compare(o1.getItem(), o2.getItem()) * -1;

    }

    public static ItemReleaseComparator getInstance() {

	if (instance == null) {
	    instance = new ItemReleaseComparator();
	}

	return instance;
    }

}
